package com.yeyks.common.em.mattress;

public enum OrderInfoMattressStatusEnum {

    PRE_PAY(1, "待支付"),
    STARTUP_SUCCESSFUL(2, "启动成功"),
    STARTUP_FAILED(3, "启动失败"),
    PAYMENT_FAILED(4, "支付失败"),
    REFUND(5, "已退款");

    int value;
    String desc;

    OrderInfoMattressStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDesc(int value) {
        OrderInfoMattressStatusEnum[] orderInfoMattressEnums = values();
        for (OrderInfoMattressStatusEnum orderInfoMattressEnum : orderInfoMattressEnums) {
            if (orderInfoMattressEnum.value() == value) {
                return orderInfoMattressEnum.desc();
            }
        }
        return null;
    }

    public static Integer getValue(String desc) {
        OrderInfoMattressStatusEnum[] orderInfoMattressEnums = values();
        for (OrderInfoMattressStatusEnum orderInfoMattressEnum : orderInfoMattressEnums) {
            if (orderInfoMattressEnum.desc().equals(desc)) {
                return orderInfoMattressEnum.value();
            }
        }
        return null;
    }

}
